package com.library.lms.service.impl;

import com.library.lms.dao.BooksBorrowMapper;
import com.library.lms.entity.BooksBorrow;
import com.library.lms.service.BooksBorrowService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class BooksBorrowServiceImpl implements BooksBorrowService {
    @Resource
    private BooksBorrowMapper booksBorrowMapper;
    @Override
    public int addBooksBorrow(BooksBorrow booksBorrow) {
        return booksBorrowMapper.insertBooksBorrow(booksBorrow);
    }

    @Override
    public List<BooksBorrow> selectBooksBorrow(Long id) {
        return booksBorrowMapper.selectBooksBorrow(id);
    }

    @Override
    public int returnbook(Long id) {
        return booksBorrowMapper.returnbook(id);
    }
}
